{% extends "base.html" %}

{% block title %}Distributed Log - Alerts{% endblock %}

{% block content %}	
		{% block latest %}{% endblock %}
        <h2>My Alerts</h2>
        <table cellpadding="3" cellspacing="3" border="0" width="100%" style="border: 1px solid;">
			<thead>
            <tr style="background-color: #FFFF00;">
				<th />
                <th>Filter</th>
				<th>Sent to</th>
				<th>Format</th>
				<th>Authentication</th>
            </tr>
			</thead>
			<tbody>
            {% for alert in alerts %}
			<tr class='{% cycle row_even,row_odd %}'>
				<td>
					<a href="/alerts/delete" id="del_alert"
							onclick="if (confirm('Really delete the alert?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'DELETE'; f.action = this.href; var m = document.createElement('input'); m.setAttribute('type', 'hidden'); m.setAttribute('name', 'key'); m.setAttribute('value', '{{ alert.key }}'); f.appendChild(m);f.submit(); }; return false;"
						<image alt="Delete" border="0" src="/images/bin.png" />
					</a>
				</td>
                <td>
					<a href="/?filter={{ alert.filter.key }}">
						{{ alert.filter.to_string }}
					</a>
				</td>
				<td>{{ alert.method }}&nbsp;{{ alert.url|escape }}</td>
				<td>{{ alert.payload|escape }}</td>
				<td>{{ alert.authentication|escape }}</td>
            </tr>
            {% endfor %}
			</tbody>
        </table>
		<br />
		To add an alert, click the alert icon next to the desired filter on the <a href="/filters">filters page</a>
{% endblock content %}	